Programmable supervisory circuit and applications therefore

ABSTRACT

The invention herein provides a supervisory circuit which is adapted to monitor an input signal and produce as an output signal, a parametric signal corresponding to the input signal. The circuit includes an input for receiving the input signal, and a stochastic processor coupled to the input for receiving the input signal and processing it to derive a signal that represents a parametric measure of the input signal. An output connected to said stochastic processor provides the parametric output signal as an output for supervisory purposes.

FIELD OF THE INVENTION

This invention relates to supervisory circuits for the measurement oflow frequency signals and control of power supplies.

BACKGROUND OF THE INVENTION

Electrical measurement metering in power management has beentraditionally carried out by analog devices while the electronicsindustry has been basically converted from analog devices to digitaldevices primarily computers and other electronic digital apparatus. Inkeeping with the development of the electronic field it is importantthat electronic devices such as power management devices be reduced tovery small size but still maintain increased flexibility to improveturnaround time in manufacturing so that a basic circuit design can beused in many different devices with only minor modification orreprogramming at the most to fulfill the new function or provide the newvoltage or power levels desired.

The need for reliable power supplies has become increasingly importantas circuit densities and hence functionality of the various systemspowered by these power supplies continue to rise. Unforeseen failure ofpower supplies in a computer system, for example would be catastrophic,as it can result in the loss of valuable data. As a result, constantsupervision or monitoring of the power supply is required and this hasmade it necessary to include specialized power supervisory circuitswithin such systems. These supervisory circuits keep the over all systeminformed about the integrity of the power supply and hence allows forthe safe shutdown of the dependent systems in case this integrity isbreached.

Generally, supervisory circuits monitor the voltage or current levels ofanalog voltages or currents and inform the system on whether the signalsare within the allowed range of operation. The operating range is fairlylarge (typically +/- 10% of a pre-specified value) and hence, theresolution required to monitor the signal is not too demanding with a+/- 2% full-scale resolution being sufficient. Furthermore, themonitored signals have low bandwidths since they are usually the dcoutput voltage (current) or ac-line input voltage (current) of the powersupply. A supervisory circuit, however, may be required to monitor anumber of signals simultaneously as a mixed analog-digital system mayoperate off a number of different voltage levels. Existingpower-supervisory applications specific integrated circuits (PS-ASIC)are primarily analog in nature and function sufficiently well in thiscontext. These PS-ASICs, however, are found to be inflexible to changesin component tolerance values that occur during the manufacturingprocess and are fixed in their signal processing operations once theyare set into the product. It would be advantageous therefore to have aPS-ASIC that would accommodate drifts in threshold values due to aging,product upgrades during the lifetime of a product, and alteration of thesignal processing capabilities of the PS-ASIC.

Such a PS-ASIC would be "reconfigurable" or field upgradeable and alsomake possible the use of a single PS-ASIC in a wide range of similarproducts thereby reducing development costs and time to market.

Until recently, analog based circuit techniques were used for signalprocessing. These circuits were implemented in bipolar technology andrequired the use of accurate voltage and current sources as well asprecision resistor divider networks for every parametric thresholddetection routine used. This was area intensive and due to the driftsthat occurred in the references it was also found to be prone to failurein terms of meeting operating specifications. Furthermore, the advent ofswitched-mode power supplies introduced the ASIC to noisier operatingenvironments making it even more prone to false threshold detectionproblems. Masking times for threshold faults were achieved by the use ofexternal components (to set RC time constants) which made the PS-ASIConce again susceptible to component tolerance problems. As far as morecomplex computation were concerned, they all basically relied onobtaining the average time that a waveform (such as the ac line voltage)exceeded a certain threshold value before the resulting average wouldtrip a parametric test. Hence, the computational complexity of thesecircuits was limited. Finally, the ASIC was fixed in terms of itsapplication to a specific product and hence was not flexible to operateon updated specifications on the same product or other products. Theseproblems have thus made the use of present implementation techniquesunattractive.

Switched capacitor circuit techniques make it possible to designprogrammable mixed analog-digital circuits. For example, a "programmablecapacitor array" (PCA) used in an amplifier feedback can result inprogrammable gains that are controlled by digital co-efficients. PCA'scan be used in comparator circuits to obtain programmable trip points bydistributing the charge in the PCA to attain the desired thresholdvoltage. This technique can give a fair degree of programmability interms of some basic signal processing. However, using PCAs as theprimary implementation technique can be expensive in terms of an ASIClayout. For example, an eight bit resolution would require a capacitancespread, (Cmax/Cmin) of 256. Since very small capacitors are undesirabledue to increased noise (kT/C noise) and mask resolution inaccuracies andin addition need to be at least an order of magnitude greater than theparasitic capacitance within the circuit (the gate-to-source capacitanceof a minimum size CMOS transistor in a typical 1.2 micro-meters CMOSprocess is 20 Femtoferads (fF)) one is limited in the maximum value ofcapacitance chosen. For a Cmin of 200 fF, a Cmax/Cmin of 256 would givea Cmax of 51 pF. Given that in a typical 1.2 micro-meter CMOS process, 1pF occupies approximately 1290 micro-meter² this makes Cmax alone occupy66,000 micro-meters² (approximately 102 mil²). One can see that arearequirements may become quite demanding for an implementation thatrequires a number of such switched capacitor configurations.

U.S. Pat. No. 5,345,409 makes use of digital signal processors (DSPs)and is incorporated herein by reference. Digital signal processors havegained widespread use in a number of applications including powermonitoring as can be seen by the above reference. They are capable ofcomputationally intensive tasks and are programmable by software. Thereference discloses a programmable power metering ASIC comprised of amixed analog-digital circuit that uses a customized DSP forcomputations. Six Delta-Sigma analog to digital converters are used toprovide an oversampled serial bit-stream of information from the sixsource signals (three in voltage mode and three in current mode). Thisinformation is low pass filtered and decimated using digital filteringtechniques. The resulting output is fed to the DSP which has twoprogrammable processors that are used to execute calibration andcomputing operations using the algorithms stored in and off-chip PROM.This allows the ASIC to compute the RMS values, real and apparent powerconsumptions and power factor rating of the source signals. The finalreadings are measured to give an absolute accuracy of 0.04% when usingthe calibration coefficients. The performance of this implementationcomes at the expense of silicon die area. The ASIC corresponding to thestructure disclosed in the reference occupies about 6.4 mm×7.1 mm in 1.5micro-meter CMOS technology (most of which is occupied by the DSP) inorder to monitor six signals.

One of the objectives of the present invention is to provide sufficientsignal processing capability while minimizing the amount of silicon diearea required in order to reduce cost and still provide the necessaryfunction.

The invention described herein provides a moderately accurate (less than2% full-scale error) programmable supervisory circuit that can monitor anumber of critical low frequency signals in a complex power supply byapplying stochastic and pulse density based computational techniques.

Stochastic computing techniques were developed in the mid-sixties in aneffort to obtain parallel computing structures for neural networks.Stochastic computing relies on principles based on Boolean algebra andprobabilistic mathematics. Analog quantities are represented in terms ofa probabilistic digital bit-stream and the resulting hardware needed forsignal processing becomes very simple in comparison to that required byconventional digital or analog methodologies. This hardware simplicitycomes at the expense of computational accuracy but the desired operatingspecification for a supervisory circuit can still be easily met.Furthermore, the implementation in digital circuitry gives it anadvantage over analog implementations since it means better noiseimmunity (important in switch mode power supplies) and easiertestability. Most importantly, it also allows the circuit to bereconfigurable when field-programmable gate array technology is used.The encoding of the analog signal can be done by using Delta-SigmaModulation (DSM) to obtain a highly oversampled serial pulse densitymodulated digital bit-stream. This encoded representation of the analogsignal can then be processed by a stochastic computer. Delta-Sigmamodulation can be used to simplify digital filter structures byproviding an alternative way to multiply digital filter coefficients ina filter. This is used to advantage in one aspect of the invention inorder to implement one aspect of the supervisory function.

The invention herein provides a power supervisory circuit and attendantapplications which together provide simplicity, robustness andprogrammability with the integration of stochastic and DSM basedcomputations to perform threshold, means squared and RMS outputs whichcan be used to control power supplies or for monitoring purposes.

SUMMARY OF THE INVENTION

The invention herein provides a supervisory circuit which is adapted tomonitor an input signal and produce as an output signal, a parametricsignal corresponding to the input signal. The circuit includes an inputfor receiving the input signal, and a stochastic processor coupled tothe input for receiving the input signal and processing it to derive asignal that represents a parametric measure of the input signal. Anoutput connected to said stochastic processor provides the parametricoutput signal as an output for supervisory purposes.

Typically the input signal is an analog voltage and the stochasticprocessor is adapted to produce an output voltage signal which isproportional to the RMS value of the voltage of the input signal.

The supervisory circuit may preferably comprise an input for receivingthe input signal, a mean square processor for determining the meansquare value of the input voltage; a conversion processor for convertingthe mean square value into a random pulse density modulated bitstreamrepresentative of the mean square value; a stochastic processorconversion processor for converting the random pulse density modulatedbitstream into a stochastic representation of the RMS value of the inputvoltage, and an output for outputting the stochastic representation ofthe RMS value.

An embodiment of the supervisory circuit for deriving a parametricoutput signal of an analog input signal may comprise an inputdelta-sigma analog to digital converter adapted to produce a serialpulse density modulated bit stream representation of the analog inputsignal, a running averager processor adapted to process the bit streamrepresentation of the analog input signal to produce a representation ofthe running average of the bitstream; a multi bit modulated squarerprocessor adapted to calculate the square of the running average andintegrate the square over a suitable time period to derive a parallelbinary representation of the mean square value of the analog inputsignal; a randomizer adapted to convert the binary representation of themean square value of the analog input signal to a serial random pulsedensity modulated bitstream; a stochastic square root processor adaptedto process the random pulse density modulated bitstream to produce aparametric signal corresponding the root mean square value of the analoginput signal; and, output means to output said root mean square valuesignal.

In another embodiment the stochastic square root processor is adapted toaccept the serial random pulse density modulated bitstream as input anduses as negative feedback the stochastic square of the output of thestochastic processor to produce an output corresponding to the root meansquare value of the analog input signal.

The running averager processor may be adapted to process the serial bitstream representation of the analog input signal to produce a parallelrepresentation of the running average of the bitstream

Preferably, the multi bit modulated squarer processor is adapted tocalculate the square of the running average by modulating the average bythe serial pulse density modulated bitstream representation of theanalog input signal to obtain a multi bit representation of the analoginput signal squared, and integrate the square over the period of theinput signal or a suitable timer period to derive a parallel binaryrepresentation of the mean square value of the analog input signal.

The stochastic square root processor may include:

a) an up down counter having incrementing and decrementing inputs, andan output, and being adapted to receive the random pulse densitymodulated bitstream at the incrementing input, the output signal of thecounter being converted by a randomizer to an output random pulsedensity modulated bitstream,

b) a feedback circuit, the output bitstream being further modified bythe feedback circuit to provide a decrementing input to the counter, thefeedback circuit comprising:

i) a decorrelator to decorrelate the output bitstream; and,

ii) means to feed back the boolean product of the output bitstream andthe decorrelated bitstream (obtaining a squared representation of outputvalue of the counter) to the decrementing input of the counter,

the output signal of the counter representing the square root of themean square input, thereby producing a parametric signal whichcorresponds to the root mean square value of the analog input signal.

The supervisory circuit may further include a threshold status apparatusadapted to respond to a signal derived by a processor of the supervisorycircuit to produce a threshold status output when the signal is within apreselected range of values. The threshold status apparatus maypreferably be adapted to respond to the signal when the signal is withinany of acceptable, unacceptable, or marginal range of conditions.

The threshold status apparatus may be adapted to respond to the rootmean square value output of the supervisory circuit, or the outputsignal of any of the processors of the supervisory circuit may be madeavailable externally.

Another aspect of the invention provides a power supply which includes apower convertor for converting an input into a regulated output, and asupervisory circuit for supervising the power convertor. The powerconvertor is governed by the supervisory circuit, the supervisorycircuit providing an output control signal to the power convertor whichis derived from stochastic processing of an analog input signalcorresponding to the input to the power supply.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention herein is depicted in its various embodiments in thedrawings of which:

FIG. 1 depicts a configuration of one embodiment of the supervisorycircuit of the invention employing a delta-sigma ADC;

FIG. 2 depicts a similar configuration without said ADC for use withdigital signals;

FIG. 3 depicts another configuration with a serial and parallel outputfrom its stochastic square root circuit;

FIG. 4 depicts another configuration with a serial and parallel outputas in FIG. 3 and without threshold status indicators;

FIG. 5 depicts a configuration similar to FIG. 4 with a parallel outputfrom said stochastic square root circuit;

FIG. 6 resembles FIG. 5 omitting said delta sigma ADC for digital signalinputs;

FIGS. 7, 8, and 9 resembles FIG. 5 however presenting status indicationsat the outputs of different processors of said circuit;

FIG. 10 depicts a power supply incorporating a supervisory circuit inaccordance with this invention;

FIG. 11 depicts a circuit for stochastic multiplication;

FIG. 12 depicts a circuit for stochastic summation;

FIG. 13 depicts a circuit for stochastic integration;

FIG. 14 depicts the generation of a stochastic bit-stream from anintegrator;

FIG. 15 depicts a stochastic integrator with negative feedback;

FIG. 16 depicts a stochastic steepest descent divider circuit;

FIG. 17 depicts a stochastic steepest descent square rooting circuit;

FIG. 18 depicts a variable probability generator or randomizer;

FIG. 19 depicts a first order delta sigma modulating analog to digitalconverter;

FIG. 20 depicts a FIR filter implemented using DSM input and PCM filtercoefficients;

FIG. 21 depicts a programmable threshold detection circuit;

FIG. 22 depicts a signal flow-graph for a threshold detection circuit ofthe invention;

FIG. 23 depicts the frequency response and pole-zero plot for therunning averager of the invention;

FIG. 24 depicts the multi-bit modulated squaring scheme of theinvention;

FIG. 25 depicts the error of the multi-bit modulated squaring scheme;

FIG. 26 depicts the frequency response of the DSM and running averager;

FIG. 27 depicts the spectral characteristics of the multi-bit modulatedsquarer output as a result of frequency domain convolution;

FIG. 28 depicts the spectral plot of signals in the multi-bit modulatedsquaring scheme for sinusoidal inputs;

FIG. 29 depicts the spectral plot of signals in multi-bit modulatedsquaring scheme for dc inputs;

FIG. 30 depicts the computing error as a function of counter size for amixed squaring scheme;

FIG. 31 depicts a stochastic square rooting scheme;

FIG. 32 depicts a contour plot of computing error as a function of n andD for the stochastic square-rooting scheme using a sample size of 32k;

FIG. 33 depicts the computing error for stochastic square rooting usingn=7 and D=12 with a 32k sample size;

FIG. 34 depicts the RMS processing measurement scheme;

FIG. 35 depicts the computing error of the RMS measurement scheme;

FIG. depicts the spectral distribution for rectified sinusoidal andtriangular waveforms;

FIG. 37 depicts a stray insensitive offset compensated single ended DSMcircuit;

FIG. 38 depicts a differential structure of a stray insensitive offsetcompensated DSM circuit;

FIG. 39 depicts a block diagram of a voltmeter circuit;

FIG. 40 depicts a state diagram for the RMS controller;

FIG. 41 depicts the implementation of the ROM based randomizer;

FIG. 42 depicts a functional block diagram of one embodiment of the RMScircuit;

FIG. 43 depicts a generic layout for the supervisory circuit;

DETAILED DESCRIPTION OF THE INVENTION

Referring to FIG. 1 which depicts one implementation of a supervisorycircuit 1 in accordance with this invention. The circuit is adapted toreceive at input 2 an analog input signal (a voltage of unipolar naturein this case). Delta sigma modulator 3 provides analog to digitalconversion of the input, the digital output which is in the form of apulse density modulated serial bit stream corresponding to the level ofthe input signal. Running Averager 4, further described later, and itsassociated circuitry is adapted to provide a running average Vavg 14 ofthe signal output on line 18 from the Delta Sigma Modulator 3 and also athreshold status signal 11. The running average information which is inparallel binary form can be used to provide output information at Output1, also to address a threshold circuit, e.g. PROM 8 to provide athreshold status signal 11. The PROM 8 may advantageously be programmedwith user specified values corresponding to satisfactory andunsatisfactory levels to provide go, no-go, and standby signals.

The parallel binary mean square signal output provided by the multi bitmodulated squarer provides input data to the stochastic square rootcomputation circuit 7. The stochastic computation circuit advantageouslymay either include an internal randomizer 6 or use an external one suchas described in the section on representing an analog quantity and FIG.18 to provide a random serial bit stream in the form of a random pulsedensity modulated serial bit stream (see FIG. 3 signal output line 26)and a stochastic square root computation circuit 7 such as described inthe section on representing an analog quantity.

The parallel binary representation of the means squared value providedby the multi bit modulated squarer 5 is transformed into a serial randompulse density modulated bit stream as described in the section onrepresenting an analog quantity.

The stochastic square root circuit 7 operates on this serial bit streamto provide a stochastic representation of the RMS voltage of the inputvoltage as either a parallel binary representation on line 16 of thesquare root of the input voltage value, and/or in addition a serialrandom pulse density modulated bit stream on line 26 representing theRMS of the input signal as described in the section on representing ananalog quantity and FIG. 17. The parallel or serial signals can be usedas aforesaid, for instance to provide external signals for controlling apower control converter or if used to address a threshold circuit asillustrated to provide a go, no go, or standby signal.

The stochastic square root circuit can produce both serial and paralleloutput, the serial output being produced with the aid of the randomizer.

The concatenation of the outputs of the internal components of thesupervisory circuit results in a output signal from the stochasticsquare root circuit which represents the root mean square value of theoriginal input signal; the successive operations of averaging, squaringthe average value obtained, and extracting the square root of thisresulting in the production of a signal representing the root meansquare value of the input signal.

In the implementation of the invention depicted the sequence controller25 controls the sequence in which operations are performed, so thatoperations are performed in the correct sequence, e. g. the mean squarevalue is obtained before the root mean square and the mean square isevaluated over a predetermined period of the input signal. A zerocrossing detector can be used to assist in the determination of theperiod of a periodic signal, which can be used to determine theappropriate integrating interval to use for the purposes of thesupervisory circuit functions.

FIGS. 1 to 9 present different implementations of the invention herein.The delta signal converter 3 is not needed where a suitable digitalinput signal or voltage is presented at input 2 as will be readilyappreciated by those skilled in the art.

Referring to FIG. 10 which represents the supervisory circuit 1 in theenvironment of a power supply 29, it may be seen that the power supplycomprises a power converter 27 which is adapted to condition an inputvoltage at input 32 to produce regulated AC or DC at output 33. The ACto DC conversion process will not be discussed in further detail as thetechniques for achieving this are well known, with the exception ofmentioning that the supervisory circuit of this invention is especiallywell suited to operate with switching power supplies or those acceptingdigital control.

The power converter 27 provides an output signal Vout which in thisexample is unipolar and is used by the supervisory circuit 1. In thisembodiment the threshold status output 11, 12 or 13 of the supervisorycircuit is fed to a shutdown or standby control input 30 of the powerconverter to protect it from unacceptable conditions, for instance bycausing it to shut down; or to transfer it to a standby mode in certaincircumstances, e.g. to prevent additional loading from carrying it intoa operating region where damage will result. For instance in the case ofDASD storage devices used in the computer industry, when power supplyoutput becomes marginal, e.g. due to heavy loading or inadequate sourcevoltage, the threshold outputs may be used to prevent additional writeoperations by the read/write heads of the DASD disk drive units.

The control feedback input port 31 is adapted to accept digital inputcontrol signals from the supervisory circuit, such as may be deliveredfrom the Vaverage 14, Mean square 15, or RMS 16 outputs of thesupervisory circuit described above. One or more of these supervisoryoutputs can be used to provide the information on the input power to thepower converter that are necessary to enable the power converter toperform its regulation functions.

As a result of the stochastic processing techniques applied theregulation process achieved by the power supply becomes more robust andimmune from noise.

Stochastic Computing

Representation of an Analog Quantity

In stochastic computing, analog quantities are represented in terms ofthe probability of obtaining a logical `1` in a corresponding digitalbit-stream. In other words, for a unipolar analog quantity A, in therange of O≦A≦V, the analog value may be represented by a digitalbit-stream, B, such that the expected value of B, denoted E[B], isdefined as:

    E[B]=A/V=p

For bipolar analog signals in the range -V≦A≦V, the analog value may berepresented by the digital bit-stream as:

    E[B]=A/(2V)+1/2=p

Hence, for a unipolar representation, the normalized value of the analogsignal, A/V, becomes the expected value of the bit-stream. For bipolarsignals, however, the expected value is represented by half thenormalized analog value, A/ (2V) added to an offset of 1/2. Thus, for a2.5 V analog input with a full-scale range of 5V,p=1/2 for a unipolarrepresentation while p=3/4 for the bipolar case. Ideally, the successivelogic levels, B_(i), in the digital bit-stream, are statisticallyindependent and hence, over a long sample size, N, the resultingbit-stream assumes a binomial distribution with an estimate of pobtained as: ##EQU1##

The outcome of each sample B_(i) in a sequence of length N assumes onlyone of two possible value and the outcome on any particular trial doesnot influence the outcome of any other trial, with the probability of anoutcome being constant from trial to trial.

The above relation for p shows that its accuracy cannot be measuredexactly but only estimated and that the accuracy of the estimationdepends on the sample size used. This dependence of the accuracy on thesample size is further accentuated by the fact that the analog signalbeing sampled may be time-varying. Hence, the assumption of a constantexpected value is only valid when the ratio of the sampling frequency tothat of the analog signal frequency is large enough to ensure that thesignal level does not change appreciably over an estimation periodconsisting of N samples. Assuming that the sampling frequency is largeenough, the error between the estimated value, p, and the expectedvalue, p, may then be expressed in terms of a statistical variance. Fora binomially distributed bit-stream, the variance, σ², for the estimatep over a sample size, N, is given by: ##EQU2##

Hence, we have seen that normalized unipolar analog signals in the range[0, 1] and normalized bipolar analog signals in the range [-1, 1] can bemapped into the probabilistic range [0, 1]. In practice, however, thestochastic computing structures required for bipolar signals have twicethe hardware complexity of unipolar computing structures along withtwice the standard deviation, σ, of a unipolar computation. As a result,we will only consider systems in which the analog input is unipolar.Operations on bipolar signals will be carried out by simply rectifyingthe ac signal, as this is satisfactory for the computations (such asRMS) that will be executed.

Given a probabilistic representation of an analog value in terms of adigital bit-stream, one od can proceed to use Boolean logic gates tooperate on these bit-streams and perform mathematical operations thatwould otherwise be difficult to realize in the analog domain from whichthe signals originated. The following section will illustrate how thisis achieved.

Stochastic Multiplication

From basic probability theory, one may recall that the joint probabilityof two random variables, X and Y with probabilities x and y are:

    P(X,Y)=P(X|Y)P(Y)                                 (2.2)

In words, this states that the joint probability of observing X and Ytogether is equal to the probability of observing X given that Y hasoccurred (conditional probability), multiplied by the probability ofobserving Y. However, if X and Y are independent, then the jointprobability simply reduces to:

    P(X,Y)=P(X)P(Y)=x-y                                        (2.3)

Given that X and Y are Bernoulli random variables (any random variablewhose only possible values are 0 and 1), the above relation may betranslated to the realm of digital logic, If one looks at the truthtable for a logical AND gate as shown in Table 2.1, one can see that alogical AND gate will act as a multiplier, provided that X and

                  TABLE 2.1                                                       ______________________________________                                        Truth table for a logical AND gate                                            X              Y     out = X · Y                                     ______________________________________                                        0              0     0                                                        0              1     0                                                        1              0     0                                                        1              1     1                                                        ______________________________________                                    

Y are independent of each other. This is the basis for stochasticmultiplication and is illustrated in FIG. 11. If X and Y are dependentor correlated in some way, then the conditional probability case ofEquation 2.2 applies and the AND gate 34 no longer acts as a perfectmultiplier. This effect of signal correlation is an important factor toconsider when implementing any practical stochastic computing functionand it will be addressed in the section on development of supervisoryfunctions as a design issue. Since the two inputs need to be independentof each other, if one required a squaring function, one would not tiethe two inputs of the AND gate to the source directly. Such a schemewould is result in the output reflecting the input and this provides agood illustration of how the multiplying effect is lost when the twosignals are fully correlated.

If one has a signal with a flat spectral content like that of whitenoise, then the auto-correlation of that signal would be a deltafunction. The delayed version of that signal cross-correlated with theundelayed or original signal would, hence, result in a function withzero correlation. This in effect means that a squaring scheme on a trulyrandom signal can be executed by feeding that signal and its delayedversion as the two inputs to the AND gate. Assuming that a randombinomially distributed signal is available for such a squaring scheme,one can calculate the output variance, δ² _(out), of the squaringcircuit with input probability p (i.e. p equals the expected value ofthe input) as follows:

    P.sub.out =(p)(p)=p.sup.2

From Equation 2.1,

The maximum variance, MAX(σ² _(out)) for Equation 2.4 then occurs atgiving:

The maximum variance may be reduced if ones uses a random signal on oneinput and ##EQU3## a deterministic signal with a mean value equal to theexpected value of the random signal on the other, as pointed out byGaines [9]. In this case, given a random signal with an expected valueof p and a deterministic signal with a mean of K=p, the output variancemay be calculated as: ##EQU4##

The maximum variance in this case occurs at p=2/3 giving: ##EQU5##

This can be clearly seen to have a lower variance than that obtained inEquation 2.5. The drawback to this approach is that the outputbit-stream no longer has a delta function auto-correlation, making theresulting output unusable for further stochastic computations. It willbe seen in the section on supervisory functions that this is not aproblem for our particular application and, hence, we will use Equation2.6 as the expression for variance in our analysis for such a scheme.

Given the output variance, one would then like to obtain the samplesize, N, required for a desired accuracy. To do this, we need to makesome assumptions on the output probability distribution, in order togain some insight into the sample sizes that may be required. Hence, wewill assume that the output bit-stream still retains its Binomialdistribution despite the comments made in the earlier paragraph. If thisassumption is made, the output probability distribution will assume aGaussian distribution for large sample sizes, as determined by theCentral Limit Theorem in statistics. The probability distributionfunction, f(x), for the variable x with mean, μ, is then described by:##EQU6##

Given that a desired (full-scale) resolution of +/-r is required fromthe output and that we would like the output to have this resolutionwith a high degree of confidence, one may proceed to calculate thesample size that is required for the specified parameters of resolutionand confidence levels. The cumulative probability, Φ(Z_(a)), for thestandard normal distribution function, is the value for the standardizedcase when δ=1 and μ=0 in Equation 2.8 so that Φ(Z_(a)) may be definedas: ##EQU7##

The value of this integral is well tabulated in statistical literaturefor various values of Z_(a). Hence, for a desired full-scale resolutionof +/-r, we would like the output value to fall within a distance of+/-r of the mean value with the specified degree of confidence given byφ(Z_(a)). Since Z_(a) refers to (Z_(a) is chosen such that it accountsfor the negative tail of the distribution as well) the number of(normalized) standard deviations, δ, (standard deviation is thesquare-root of the variance) that fall within the confidence interval,we need to scale this normalized version to obtain the resultingdeviation. This is simply done by multiplying the δ obtained for ourscheme with the Z_(a) obtained for a certain confidence level. Thus, thetotal length, L, of the interval in which the output value can fall istwice the resulting deviation obtained since the value obtained forZ_(a) only accounts for half the distance (i.e. +r and not +/-r). Inother words, L is:

    L=2Z.sub.a ×σ                                  (2.9)

Substituting the worst case a from Equation 2.7 for the case when adeterministic sequence is multiplied with a random Bernoulli sequenceone obtains: ##EQU8##

Solving for the sample size N gives: ##EQU9##

If one used two random signals to obtain the δ² of Equation 2.5, thenthe sample size, N, required is: ##EQU10##

One can see from Equations 2.11 and 2.12, therefore, that the samplesizes required for the mixed case of Equation 2.11 is much less thanthat needed according to Equation 2.12. This is best illustrated with anumerical example, where, for a full-scale resolution of +/-1% (i.e. 40dB resolution with a safety factor of ±0.5% taken for desired ±1%error), and a confidence level of 4.5δ (i.e. 99.9997% confidence level),the worst case sample size required for the mixed random-deterministicmultiplication scheme gives (from Equation 2.11): ##EQU11##

If two random signals are used in the multiplication scheme one gets(from Equation 2.12):

This shows that for the given specifications, the purely randommultiplication requires a sample size that is 68% larger than that ofthe mixed-signal scheme. ##EQU12##

In this section on stochastic multiplication, we have explored the issuewith a fair amount of depth to give the reader an appreciation of theissues that are involved in implementing what appears to be a fairlysimple operation at first glance. It must be mentioned again that thederivations obtained in this section were based on simplifyingassumptions, such as the signals being binomially distributed. Thisallowed us to obtain an idea of the effects that various parameters haveon accuracy and sample sizes and does not in any way try to describe theactual signal distribution obtained in the implementations.

Stochastic Summation

Assuming that we have two statistically independent signals once again,stochastic summation can be estimated by using a logical OR gate. If onelooks at the logical truth table for an OR gate as shown in Table 2.2,one notes that in probabilistic terms, the output probability, Pouts forobtaining a `1` is:

    P.sub.out =P(X)P(Y)+P(X)P(Y)+P(X)P(Y)

Denoting P(Y)=y and P(X)=x we get

    P(X)=1-x and P(Y)=1-y

so that

    P.sub.out =(1-x)y+x(1-y)+xy=x+y-x-y

The cross product term, x·y, introduces an error in this simplesummation scheme. If x and Y are mutually exclusive independent events,however, then the cross product term is eliminated. One way to do thisis to introduce a third variable, K, as shown in FIG. 12.

                  TABLE 2.2                                                       ______________________________________                                        Truth Table for a logical OR gate                                             x                y     out                                                    ______________________________________                                        0                0     0                                                      0                1     1                                                      1                0     1                                                      1                1     1                                                      ______________________________________                                    

This variable makes X and Y mutually exclusive since P_(out) is nowgiven by:

    P.sub.out =P(K)P(X)+P(K)P(Y)

The variable, K, eliminates the cross product terms and also ensuresthat the result of the summation does not exceed one, due to the scalingfactor introduced by the intermediate product terms. For P(K) beingdenoted by k, the output probability, P_(out) may be rewritten as:

    P.sub.out =kx+ky

With k=0.5, for example, the resulting sum may be seen to be exact andscaled by one-half.

Stochastic Integration

Integration of a stochastic bit-stream is easily performed by using adigital counter as a discrete integrator. For example, an up/downcounter can compute the resulting integral of the difference of twoinput signals over a count period, k, as shown in FIG. 13. The size ofthe counter determines the time constant as well as the variance of theresulting estimate of the integral. The variance for a binomial input isonce again given by: ##EQU13## where N is the size of the counter andfor an n-bit counter N=2^(n). The resulting sum in the integrator may beexpressed as: ##EQU14## where T is the clocking period of the counter.It can be seen that a trade-off between accuracy and bandwidth occurs,since an increased counter size reduces the bandwidth (increases timeconstant) but increases the resolution (decreases variance).

At this time, one may note that the counter stores the integral in aparallel binary form. This is of no use for further stochastic computingunless a stochastic bit-stream with a mean value equal to the normalizedvalue of the counter's contents (normalizing factor is 2^(n) for a n-bitcounter) can be generated. This can be done by using a digitalcomparator as shown in FIG. 14 the comparator compares the count in thecounter with a random variable, R, having the same size, n, as that ofthe counter. Each bit of the random variable, R, is required to have anequal probability of being `1` or `0` (i.e. P(R_(i))=0.5. If such arandom number can be generated, then the resulting probability of thecomparator's output will have a mean value equal to the normalized valueof the counter contents. This can be illustrated with a simple exampleusing a 4 bit counter (n=4) with a count value arbitrarily chosen as 12.The normalized counter value is then 12/(2⁴)=0.75. If we now have a 4bit random number with each bit R_(i) having an equal probability ofbeing `1` or `0`, that is:

    P(R.sub.i)=0.5, for i=1,2,3,4

then the probability that this number exceeds the normalized count valuecan be calculated by first converting the decimal count value of 12 to acount value in base 2 so that |₂ =1100. The probability that R equals orexceeds the count is then:

    P(R=1100)+P(R=1101)+P(R=1110)+P(R=1111)=4(1/2.sup.4)=0.25

Therefore, the probability of the count exceeding the random number is(1-0.25)=0.75. Hence, one can see that the digital comparator generatesa stochastic bit-stream with a mean value that estimates the counter'scontents. An alternative way of generating a stochastic bit-stream is touse the bits of the counter as a weighting coefficient to a variableprobability generator. This scheme and the generation of random numbersitself will be discussed below.

Stochastic Integration with Negative Feedback

An important configuration can be obtained if one uses an up/downcounter in a negative feedback scheme as shown in FIG. 15. This circuitacts like a leaky analog integrator and takes the running average of theinput value. For a Bernoulli input with mean, p, it has been found thatthe counter, S, with a time constant NT, tends exponentially to anestimate of p as:

    S(nT)=p+[S(0)-p]e.sup.-n/N

and that it has a variance, as before, that can be expressed as:##EQU15##

This once again indicates that there is a trade-off between the accuracyand speed or bandwidth of the configuration. This configuration was oneof the earliest stochastic computing elements to be invented and wasoriginally called ADDIE (ADaptive Digital Element). It is an extremelypowerful and useful computing element to have, and can be used to buildcomputing blocks for implicit functions such as division andsquare-root. FIG. 16 shows a division computing block and FIG. 17 showsa square-root computing block.

Stochastic Division

This section will describe how an ADDIE can be used to obtain acomputing block that does division. It assumes that the result will staywithin the range of probabilistic representation, since division by anumber smaller than one leads to amplification of the dividend. Hence,one may consider the divider circuit to be an amplifying block as well,and as such it will work as long as the output does not saturate (i.e.the output probability cannot exceed one).

An ADDIE essentially acts like an operational amplifier in a negativefeedback configuration and, therefore, it can be used as a dynamic errorreducing element. The UP and DOWN inputs of the integrator act like theplus and minus terminals of an operational amplifier and so theintegrator tries to keep its contents at a value that will make the DOWNinput track the UP input (given that the source is fed to the UPterminal). Such a configuration is termed to have a "steepest-descent"operation and the resulting scheme required to obtain division can bedevised as follows. Given P_(out) =output probability, P_(a) =dividendprobability and P_(b) =divisor probability, we require P_(out) =P_(a)/P_(b). Hence, P_(b) P_(out) should equal P_(a) and any deviation isdefined as the error, δ, where:

    δ(P.sub.b P.sub.out)-P.sub.a

Since δ² is a positive value and represents the magnitude of the error,any procedure that reduces δ² or makes its derivative negative willeventually force δ to zero. Therefore:

    δ.sup.2 =P.sub.b.sup.2 P.sub.out.sup.2 P.sub.a P.sub.b P.sub.out +P.sub.a.sup.2

For P_(a) and P_(b) =constant ##EQU16##

For this to be negative implies that δ and are of opposite signs, sothat one may write Equation 2.14 as: ##EQU17##

This relation basically states that the ADDIE integrator changes suchthat the dividend needs to feed the UP input and the product of thedivision and integrator's stochastic output needs to feed the DOWN inputof the counter. The resulting ADDIE configuration for this dividercircuit is shown in FIG. 16.

Stochastic Square-Root

The ADDIE can be configured in a fashion similar to the divider circuitto obtain a square-rooting operation. This time the steepest-descentconfiguration can be devised as follows. Given P_(in) =input probabilityand we want ##EQU18## the error, δ, is:

    δP.sub.out.spsb.2 -P.sub.in

giving,

    δ.sup.2 =P.sub.out.spsb.4 -2P.sub.in P.sub.out.spsb.2 +P.sub.in.spsb.2

Therefore, ##EQU19##

Since we need the above derivative to be negative, this means: ##EQU20##

This relation indicates that the counter changes such that the input isfed to the UP side and the square of the integrator's stochastic outputis fed to the DOWN side of the counter. This scheme is shown in FIG. 17.One may note that this type of configuration is similar to theconfigurations used in a conventional analog computing circuit where,the squaring multiplier is placed in the negative feedback loop of anoperational amplifier to provide a square-rooting function.

Random Number and Variable Probability Generation

Random Number Generation

In the past three sections, we have alluded to the existence and use ofrandom binary numbers where each bit has an equal probability of being`1` or `0`. The most common and efficient way of attaining such a numberis through the use of linear feed-back shift registers. Linear feed-backshift registers (LFSR) work by cascading n shift registers, withfeedback to the first stage coming from a combination of the outputs ofthe various stages, gated together by logical EXCLUSIVE-OR gates. Theresulting sequence of binary numbers taken in parallel from the n-stagesor in serial format from any or all of the stages, produces a sequenceof random numbers. This sequence repeats after 2^(n) -1 cycles when thefeed-back is obtained from the proper registers, to attain what is knownas a maximal-length cycle. The proper feed-back register outputs orpaths are obtained by determining the primitive factors (i.e.irreducible factors) that will produce a characteristic polynomial oforder n. The LFSR is said to produce a "pseudo-random" binary sequence,since a true random sequence would never repeat. The resulting pseudonoise (PN) sequence out of a n-stage LFSR has the following importantnoteworthy properties:

Maximal-Length cycle=2^(n) -1

Probability of 1's, P(1)=2.sup.(n-1) /(2^(n) -1)

Probability of 0's, P(0)=(2.sup.(n-1) -1/(2^(n) -1)

Auto correlation function, A(m), is repetitive with period 2^(n) -1

A(0)=2.sup.(n-1)

A(m)=2.sup.(n-2), for m not equal to zero.

From these properties it can be seen that, P(1) and P(0) approach theideal desired probability of 0.5 as n gets larger. A large n alsoelongates the period before which the cycle repeats. Experimentalresults indicate that to a first approximation, the resulting sequenceassumes a binomial distribution. The autocorrelation function is not theideal delta function of a true white noise source, however, and thisremains a practical problem. The generation of PN sequences by otherdigital methods, such as Cellular Automata (CA), indicate that betterautocorrelation functions may be attained. CA operate by changing thestate in a present cell or register, based on certain rules governingthe past values of its neighboring sites. An n=cell CA hasmaximal-length cycle of only 2⁰.61(n+1). Hybrid CA (where the rulegoverning the neighboring site's state depends on a particular cell'slocation) which are more complex, give maximal length cycles of 2^(n-) 1like LFSRs, but have distorted distribution characteristics that makethem unattractive for practical use.

It was hence decided that LFSRs be used for random number generation, asthey offer the most efficient structures to date and have well knowncharacteristics.

Variable Probability Generator

The use of variable probability generator was mentioned earlier. Thegenerator produces a stochastic bit-stream, with the generatingprobability being controlled by the binary weighting coefficients thatare fed to it. Its operation is an ingenious idea whose configuration isshown in FIG. 18. It works on the assumption that one has a set ofindependent binary random variables, a_(i), with each having a P(a_(i)=1)=0.5. Such a set of binary numbers can be obtained from a LFSR asdiscussed in the previous section. If one now generates a logicalfunction, b_(i), such that b_(1=a) ₁, b₂ =a₁ a₂, b₃ =a₁ a₂ a₃, b_(n) =a₁aa₂ . . . a_(n-1) a_(n), one notes that each of the variables, b_(i), ismutually exclusive, In other words, no more than one of the b_(i) willbe ON at any given clock cycle so that b_(i) b_(j) =0 for i not equal toj. Since the binary numbers a_(i) are independent, the variables b_(i)are binary weighted so that P(b₁)=1/2² or in general P(b_(n))=1/2^(n).Furthermore, since the b_(i) are mutually exclusive, they can be exactlysummed by an OR gate. FIG. 18 illustrates the scheme, where thecoefficients x₁,x₂,x₃ etc. denotes the binary representation of acounter content X. Using the x_(i) as weighting coefficients, one cansee that the resulting probability at the output of the generator is anapproximation to the normalized counter contents, with the resolutiongetting better as the size of the generator increases. Hence, a n-bitvariable probability generator is capable of generating a probabilisticoutput with a resolution of 2^(-n).

Thus, the variable probability generator can be used to generate astochastic serial bit-stream representative of the parallel count in anintegrator, or it can be used to generate probabilistic constants foruse in a certain computation. In either case, the probability of thebit-stream is set by the weighting coefficients x_(i).

Conversion of the Analog Input

As mentioned earlier, the objectives require that one be able to carryout signal processing functions on analog quantities. As such, werequire a front end to the stochastic or pulse density based computingsystem that will generate a pulse density modulated (PDM) bit-streamrepresentative of the analog input value. Stochastic analog-to-digitalconversion techniques were reviewed, but it was found that the resultinghardware complexity exceeded that of a simple first-order Delta-SigmaModulation (DSM) based analog-to-digital converter (ADC). Furthermore,as was noted earlier, certain computations benefit from the use ofdeterministic signals which can be provided by such a DSM. It will alsobe seen that an alternative scheme for multiplication can be devised byusing the PDM bit-stream from a DSM based ADC.

DSM based ADCs are in use in a variety of commercial products and anabundance of literature on the subject exists. Applications for DSMbased circuits continue to increase and, hence, one may consider it amature and well established technique for data conversion.

Delta-Sigma Modulation Based Analog-to-Digital Conversion

DSM based ADCs are a class of highly over-sampled data converters,where, the output data rate is many times the Nyquist frequency. As aresult of oversampling, the design of anti-aliasing filters (AAF),required at the front end of all sampled-data systems, is made verysimple. This is because the selectivity of the filter (i.e. the ratio ofstop-band to pass-band frequency) is made less stringent due to theshift of the aliased spectrum by the oversampled frequency. The shiftedspectrum pushes the stop-band to much higher frequencies making itpossible to use a very simple and inexpensive RC filter as the AAF.

The simplest DSM based ADC is a first-order, two level quantizerconfiguration and this is shown in FIG. 19. Such a scheme produces asingle binary bit-stream that is a PDM representation of the analoginput. It consists of an analog integrator that operates on thedifferences between the analog input value and the fed backdigital-to-analog converter (DAC) voltage level. Being a two levelimplementation means that the quantizer is simply a comparator and,hence, a DAC is not required in the feedback. This is in contrast to amulti-level DSM, where a DAC would be required in the feedback. Afirst-order implementation means that only one integrator is used incontrast to a cascade of integrators that would be required for higherorder implementations. Higher order DSMs are more complex and require anumber of other issues such as stability to be addressed in a practicalimplementation. In general, higher order structures or multi-levelquantizers are used to increase the signal-to-noise ration (SNR) of theconverter with the trade-off being increased hardware complexity.

The integrator in the DSM makes the analog input signal see a low-passfilter transfer function while acting as a high-pass filter for thequantization noise that is injected at the quantizer stage. As a result,the DSM is said to provide noise shaping by effectively taking thequantization noise spectrum and decreasing its power in the signalpassband while increasing it in the stopband. The oversampling ratio(OSR), defined as the ration of the sampling frequency to the Nyquistfrequency (defined as twice the maximum signal frequency), can be usedto theoretically increase the SNR to any level. This is shown by thefollowing relation for a first-order DSM with a n-bit quantizer, wheren=1 for a two level quantizer:

    SNR≈6.02n+9.03 Log.sub.2 (OSR)dB                   (2.16)

For a second-order DSM, the SNR is further improved by:

    SNR≈6.02n+15.05 Log.sub.2 (OSR)dB                  (2.17)

Hence, one may note from Equation 2.16 and 2.17 that the SNR of anoversampling DSM based ADC increases at a much faster rate for adoubling in the OSR than it does for a corresponding doubling in thenumber of quantization levels used. This is essentially because of thenoise shaping characteristics described. The high-pass noise transferfunction also means that the two level quantizer or comparator used inthe DSM can have dc offsets without affecting the accuracy of theconversion. This is because the dc offsets in the comparator may beviewed as a dc noise being injected at the quantizer stage which thenfaces a high-pass transfer function. This obviously has practicaladvantages is in that complex offset-free comparator structures are notnecessary.

Although higher order DSMs offer better SNRs due to the noise shaping,such DSMs are not attractive for use in our applications. This is partlybecause stochastic computing systems do not utilize the noise shapingcharacteristics of the DSM, since by definition, these systems operateon random noisy signals. In addition, the limit cycle oscillation ratefor a first-order DSM is higher than that of higher order, or for thatmatter, bipolar DSM structures. Such limit cycle oscillations (the rateat which the pulse pattern in the bit-stream repeats) which are normallyundesirable in acoustic applications can be of advantage in stochasticsystems since the faster rate allows for a quicker estimation of themean value of the bit-stream to be made. First-order DSMs also have alarger dynamic range for input signals and hence require less scaling tobe done on the input signal. Finally, higher order DSMs were actuallyfound to degrade the performance of the PDM squaring scheme developedlater. Hence, the simplicity of the first-order DSM structure along witha consideration of the above factors make it the most advantageous ADCscheme to use.

Computations Using Pulse Density Modulated Signals

Estimation of the Analog Input Value

Customarily, the DSM output goes through a "decimation" routine, afterwhich the resulting multi-bit word is processed by a digital signalprocessor (DSP). The decimation routine entails taking the singlebit-stream (for a 1-bit or two-level quantizer) of information from DSMand accumulating it so that a multi-bit word is generated. Thismulti-bit word is then sampled at a much lower rate than theoversampling frequency, so that a DSP may carry out conventional digitalcomputations. The decimation routine also suppresses the quantizationerror and undesired high frequency analog input noise, by acting as alow-pass digital filter. The net result of the decimation process is toprovide a mean value of the analog signal at the decimated rate.

The simplest decimator is an accumulate-and-dump circuit. For a twolevel quantizer, the accumulator is a "simple"binary counter which sumsup the DSM output over the decimation period and then resets itself forthe next evaluation. For a decimation ratio, D, defined as the ratio ofthe input frequency to the output frequency, one may express thetransfer function of this digital filter (in the z-domain) as: ##EQU21##

In this case, the input frequency is the oversampling frequency, f_(s),and the output frequency is the oversampling frequency divided by thenumber of cycles of accumulation, D. The resulting frequency response ofthis filter may be obtained by substituting z=e^(j2)πf/f S in Equation2.18 to obtain: ##EQU22##

The decimation process allows for the extraction of the mean value of ananalog signal at the rate of f_(s) /D. This multi-bit mean value may beused for further processing in both the stochastic and conventionalcomputational realms. One may proceed with stochastic computations fromthe decimated word, by using the variable probability generator asdiscussed earlier to regenerate a random pulse density modulated (RPDM)bit-stream that is representative to the mean value of the binarydecimation counter. One the other hand, one may use the counter's valueto proceed with DSP based computations, or use the count for DSM basedmultiplying schemes which will be discussed next.

Although a decimator circuit will not be used, a modified version thatproduces a running average of the analog signal will be used. Itscharacteristics are very similar to the simple decimator explained here,and its application will be discussed in more detail in the nextchapter.

Delta-Sigma Modulation based Multiplication Schemes

Digital filters are in widespread use for various signal processingfunctions. In situations where the input signal is in analog form, thefilter requires the use of an ADC to obtain a pulse code modulated (PCM)digital word upon which it can operate. This PCM word it operated uponby standard digital or DSP circuitry using multi-bit multipliers andadders. This can result in expensive hardware and as a result new DSMbased multiplication schemes have recently become of interest.

The DSM based multiplication scheme can be illustrated by showing atypical way in which an FIR filter structure. FIG. 20 shows the filterstructure, where, the analog input signal is Delta-Sigma modulated withan OSR or R (Nyquist frequency=f_(N)) and the filter coefficients are inPCM form. Each tap of the filter produces a 1-bit value and hence themultiplication can be implemented with a simple switch or logical ANDgate. In their particular application, the entire sum (or convolution)could be computed by having the tap lines act as address lines to aread-only-memory (ROM) device, where the resulting sums for a particularfilter with certain coefficients reside as the data at that addresslocation. This eliminates the need for expensive multiplication andmakes the filter programmable by changing the contents of the ROM.

The above information provides background information for a newmultiplication architecture used for mean square determination.

DEVELOPMENT OF SUPERVISORY FUNCTIONS

Threshold Detection Function

Threshold detection is one of the commonly used functions in asupervisory circuit. It entails the monitoring of a dc value andensuring that the value stays within the specified range of operation.The upper and lower levels of the range may drift due to aging, or maybe required to change due to product upgrades. Such changes aredifficult to accommodate in conventional threshold detection circuits.The invention provides a threshold detection scheme that is capable ofhaving its reference levels altered to accommodate changes.

Threshold detection, in essence, is the measurement of the"instantaneous average" value of a signal. The decimator circuitdescribed previously essentially does this and in addition also servesto act as a low-pass filter. This filtering characteristic is especiallyhelpful in avoiding false triggers caused by the presence of highfrequency switching noise in switch-mode power supplies. However, thedecimator circuit described previously reduces the rate at which thedata is re-examined so that conventional multi-bit digital computationtechniques can be used. This is done by accumulating the bit-stream dataover a certain period, D, and then dumps it to the follow-on processingcircuit so that the count obtained is only valid at the end of theaccumulation period. For our purposes, however, it is desirable to havea continuous reading of the measured value. This makes the monitoringcircuit easier to implement and also allows for the use of the thresholdcircuit in other functions such as the squaring function that will bedescribed in the next section.

A method that provides such a continuous reading or "running average" ofthe monitored signal is obtained by the circuit shown in FIG. 21. Thecircuit of FIG. 21 works by having the DSM output feed both the Up inputof an Up/Down binary counter and the first cell of a shift register. Byusing a shift register of size 2^(L) with a L-bit Up/Down counter, thecounter is ensured of not overflowing on continuous operation.Furthermore, the average value of the input signal can be read at anytime and hence, the circuit does not reduce the rate at which the datacan be read. The parallel binary output of the counter (which providesthe normalized average value of the input signal) can then be fed to adigital threshold decision circuit. This decision circuit can be builtfrom either combinational logic or a simple read-only memory (ROM)device. In either case, the parametric tests for under-voltage,over-voltage or marginal voltage on a dc signal, for example, can beexecuted simultaneously with the single threshold detection circuit.Most importantly, the threshold levels can be easily changed byreconfiguring the decision logic or reprogramming the ROM. This is incontrast to a typical analog implementation where, each test requires acomparator with a corresponding analog reference voltage whose value isdifficult to change.

The filtering characteristics of the running-averager in the thresholddetection circuit can be obtained by studying the signal flow graph ofFIG. 22. The z-domain transfer function may then be obtained as: whereL=number of bits in the Up/Down counter and D=2^(L) is the number ofshift register cells or latency. By substituting z=^(j2)πf/f_(s) inEquation 3.1, one obtains the same ##EQU23## frequency response as thesimple decimator scheme, namely ##EQU24## where once again, D=2^(L) isthe number of shift register cells and hence the maximum count in thecounter and f_(s) =sampling or clocking frequency of the detectorcircuit. The frequency response and pole-zero plots for this scheme asshown in FIG. 23. It can be seen from the transfer function that theresulting low-pass filter has zeroes at integer multiples of f_(s) /D.One can, therefore, control the placement of the zeroes by eithervarying the sampling frequency, f_(s), or the length, D, of the shiftregister. The length, D, also controls the resolution of the thresholddetection circuit and hence, once again there is a trade-off between theresolution and bandwidth that can be obtained. The signal bandwidthneeds to be restricted so that it is not affected by the filter'sfrequency response. For example, if the maximum passband attenuation ofthe signal is to be no more than 1%, then the signal bandwidth shouldnot exceed more than 1/13 of fs/D. Therefore, signals with significantharmonic content above f_(s) /13D will be subject to more than theallowed harmonic distortion. This requirement results in a relativelylarge ratio between the sampling and signal frequencies. As a result,the resolution that the DSM bit-stream is capable of providing, farexceeds the resolution that can be provided by the threshold detectioncircuit (Equation 2.16). Hence, one may conclude that therunning-averager of the threshold detection circuit controls the finalresolution of the measured signal. For a dc input signal, the resultingresolution provided by the threshold detection circuit is +/- (L+1) bitsfor a shift register length of D=2^(L). Resolution is measured in termsof a +/- deviation (full-scale) from the actual value. Hence, L+1 bitsresolution is achieved in either direction.

Squaring Function

In FIG. 20, the multi-bit filter coefficients were modulated by the DSMbit-stream, to obtain a resulting multi-bit word whose sum amounted tothe multiplication of the signal by the filtering coefficients. Thatscheme may be modified so that in place of the filtering coefficients,one now places a multi-bit word representative of the input signal. TheDSM bit-stream can then modulate a multi-bit representation of the samesource signal providing a result that is the square of the input signal.This multi-bit word may once again be generated by using therunning-averager circuit, so that the new squaring function may bedevised as shown in FIG. 24. The DSM bit-stream essentially controlswhether the multi-bit word is presented to the adder, so that at the endof a sinusoidal period, for example, the latched contents of the addercontains the integral of the squared input signal obtained over thesignal's period.

It was noted in the previous section that for a passband attenuation ofless than 1%, one had to restrict the signal bandwidth, f_(o), to beingless than 1/13 of the first null frequency (f_(s) /D) of therunning-averager's frequency response. For a 7-bit resolution, thisgives a minimum sampling frequency, f_(s), of 2⁷ ×13=1664 times thesignal frequency. Choosing f_(s) =4096f_(o) (i.e. |H(f_(o))|=0.9984) anda 7-bit counter for the running-averager are then, more than adequateparameters to obtain the desired resolution of +/- 1%. This is confirmedfrom simulations. The resulting computing error as a function of theinput amplitude is shown by the graph in FIG. 25. One notes from thisgraph that the performance is similar to that of the mixed squaringscheme, while using only 1/8 as many samples. For a 60 Hz input signal,for example, the DSM would only be required to run at 490 kHz makingthis scheme extremely practical to implement. Hence, the multi-bitmodulated squaring scheme proves to be the optimum squaring structure toimplement on the front end.

From the graph of FIG. 25, it is apparent that the computing errorincreases as the input signal level increases (except for the anomalyencountered with normalized sinusoidal amplitudes around 0.38). This isat first counter-intuitive and does not follow the probabilisticanalysis initially presented. The behavior, however, can be understoodif one analyzes it in terms of the frequency response of the variousstructures involved. In all the squaring schemes studied so far, the DSMand running-averager are used and both these elements have low-passsignal transfer functions (STF). In case of the DSM, it also has ahigh-pass noise transfer function (NTF). The resulting shapes of thefrequency response for both the DSM and running-averager are shown inFIG. 27. Since a time domain multiplication of the DSM bit-stream andthe running averager word is done, this means that the resultingfrequency response is the convolution of the two input frequencyresponse. Once can see that the resulting frequency response results ina noisier spectrum in the passband and that this characteristic getsworse as the two amplitudes, A and M, get larger. This is illustrated inFIG. 26. Fourier Transforms of the signals obtained from simulations ofthe multi-bit modulated squaring scheme confirm this analysis as shownin FIG. 28 and 29. In addition, they also confirm that the computingerror for dc inputs is worse than that for sinusoidal inputs. This isbecause the dc inputs have larger values for A and M and hence, causemore of the noise to be aliased into the passband. As far as the anomalyencountered with sinusoidal amplitudes around 0.38 is concerned, one canonly surmise that the enhanced performance results due to a higherdegree of correlation that exists between the DSM bit-stream and therunning-averager's output under the given conditions. Thischaracteristic also appears to be controlled by the bandwidth of therunning-averager circuit, since the notch occurs at higher amplitudesand is less pronounced as the sampling frequency (and hence OSR) isincreased or the size of the latency is decreased. In other words, thenotch occurs at higher input amplitudes as the bandwidth of therunning-averager circuit is increased. A detailed study of this behaviorwas not carried out and, hence, may be considered a topic for futureresearch. It was also found that increasing the order of the DSM useddid not improve the overall performance of the squaring function, sincethe output of the higher order DSMs have a larger noise spectrum outsidethe passband. This larger noise spectrum gets aliased into the passbandwhen the multiplicative process is carried out, resulting in adegradation in performance. Hence, the use of a simple first-order DSMbased ADC still appears attractive.

From the above frequency domain analysis, one may postulate that asimilar explanation can be given for the behavioral characteristics ofthe mixed or fully stochastic squaring schemes. The bit-streams arefiltered by the DSM and the running-averager circuit so that convolutionof the DSM bit-stream with itself or with the running-averager's outputresults in increased computing error as the input amplitude isincreased. Since increasing the size of the counter in therunning-averager narrows the bandwidth of the structure, one wood expectthe computing accuracy to improve for increased counter sizes. This ideais confirmed by simulations conducted on the mixed squaring scheme forvarious counter sizes and the results are shown in FIG. 30. In allcases, the worse case error (defined as the maximum computing errorobserved over the entire input range) occurred when the input amplitudeapproached the full-scale value.

From the simulations conducted on the squaring schemes of this section,it becomes apparent that the actual architecture used plays a major rolein the distribution functions assumed by the bit-streams and hence, theoverall accuracy of the computation. The probabilistic models developedpreviously for stochastic computing functions in do not take intoaccount the implementation technique used and consequently serve only asan initial design guideline.

Square-Root Function

For convenience, FIG. 31 shows the circuit scheme used once again. In anRMS function, such a square-rooting circuit would be used directly on aprobabilistic bit-stream representative of a dc value as will be shownin the next section. As such, the scheme discussed previously is moreamenable to being implemented. This is because a probabilisticbit-stream is easily generated from the contents of a register, incontrast to the DSM based conversion that is required if an analogsignal is to be operated upon.

As mentioned previously, the ADDIE size, n, and the sampling frequency,f_(s), used play an important role in determining the accuracy andbandwidth of the resulting configuration. The bandwidth (time-constant)of the ADDIE in this case, determines the speed of the feedback loop,since too large a counter means that the response time to correct thecounter contents is slowed down. This is analogous, once again, to ananalog implementation where the open-loop gain of an operationalamplifier essentially determines the tracking capability of its positiveand negative terminals when negative feedback is incorporated. Thefeedback squaring loop uses the fully stochastic squaring scheme where,the delay, D, used to decorrelate the two inputs to the AND gate, alsoplays a role in determining the accuracy. The delay required depends onthe sample size used and it increases as the sample size is increased.This is because the cross-correlation between the delayed and undelayedbit-stream rolls off more slowly as the sample size is increased.However, too large a decorrelating delay can result in the delayedbit-stream reflecting an old ADDIE value and thereby reduce theeffectiveness of the negative feedback loop. Hence, an optimum value forthe decorrelating delay and ADDIE size is required for a given samplingfrequency (sample size).

A parametric simulation of the computing error as a function of theADDIE size, n, and decorrelating delay, D, used, was thereforeconducted. The simulation was conducted by performing the computationson a probabilistic bit-stream generated from a 15-bit randomizer thatrepresented a dc value ranging from 0.1 to the full-scale normalizedvalue of 1. A 32K (2¹⁵) sample size was used for each of the parametricconditions tested. It may be noted that the clocking frequency used isnot impractical, since the entire circuit is implemented in digitallogic. FIG. 32 shows the results obtained, by displaying the worst casecomputing error as a function of the two parameters, n and D. Theseresults show that there is an optimum design parameter that can bechosen to obtain the best computing accuracy. For the parameters used inthe simulation, the smallest worst case error is obtained when the ADDIEsize is 7-bits and the decorrelating delay is 12 cycles. The computingerror as a function of the input level is shown in FIG. 33 for thisoptimum parameter.

Root-Mean-Square Function

Root-mean-square measurements are very useful in power conditioningcircuits as they can be used as a threshold detection scheme for acsignals. They can also be incorporated into more complex computationslike power-factor (PF) is: ##EQU25##

In addition to the practical uses for RMS measurements, the RMSoperation is also a good representative mathematical operation toillustrate the versatility of the computing blocks developed so far. RMSmeasurements on any signal need to be carried out in two steps. Thefirst step consists of squaring the input signal as it is being sensedand averaging the result over the signal's period. The second steprequires the square-root of this averaged result to be found.Mathematically, the RMs value of a signal V(t) with period T can bedefined as: ##EQU26##

It may be noted that in typical power signals, such as the 60 Hz acpower line, the signal is symmetric about the x-axis and hence, onlyhalf (or a quarter for a sine wave) the period needs to be used in thecomputation. This decreases the computation time required and alsoallows for the rectified version of the input signal to be used.

The previous three sections developed optimum structures for all thefundamental computing blocks are required to implement the RMS function.The final RMS function can, hence, be devised as shown in FIG. 34 usingthe optimum squaring, and square-rooting schemes developed. Simulationswere conducted using rectified sinusoidal and triangular inputwaveforms, and the DSM using an OSR of 4096 (running-averager uses 7-bitcounter). The square-rooting operation used 32,768 points percomputation. The results of this simulation are shown in FIG. 35 interms of the computing error are various input amplitudes. It can beseen that the computing error is less than -40 dB (or +/- 1%) over thefull input amplitude range and, therefore, the design meets themeasurement criteria set.

The accuracy of the RMS circuit depends on the bandwidth of the inputwaveform. Since the sampling frequency and size of the running-averagerdetermine the bandwidth of the circuit, one needs to be wary of thesignal's spectrum being affected by the filtering of therunning-averager. Rectification of the input signal also changes theinput spectrum. In the case of the rectified sinusoidal and triangularinputs, the spectra are similar in their spread and hence, the computingerror is almost identical for both types of inputs. FIG. 36 shows thespectral distribution for the rectified sinusoidal and triangularinputs.

The bandwidth of the RMS circuit also determines the crest factor (CF)obtained. The CF is defined as the ration of the peak value of awaveform to its RMS value. For example, the CF for a sinusoid is √2 andthat for a triangular waveform is √3. Commercial analog RMS meters, suchas the HP-3400A, have crest factors as high as 10. In this RMS scheme,however, the circuit bandwidth limits the CF obtained. Since the OSRused was based on the spectra of the sinusoidal and triangular inputs,input waveforms with higher frequency spectral content are attenuated bythe circuit's inherent low-pass filtering characteristics. This givesthis RMS circuit a very low CF of √3, as noted from simulations. Ahigher CF may be obtained by increasing the bandwidth of the circuit atthe expense of resolution as was discussed earlier. For the givendesign, however, the low CF is advantageous when the circuit is to beoperated in a noisy environment such as that of a high voltageswitched-mode power supply.

DMS Based ADC

The design of DSM based ADCs requires a number of factors to be takeninto account in order to obtain optimum results in terms of SNR, dynamicrange and circuit size. This section will give a brief outline of someof the factors that were considered during the design of the first-orderDSM with two-level quantization.

Since an analog external signal that needs to be processed requires anADC on the front end, the overall layout area of the ADC plays animportant role in determining the cost effectiveness of the system.Implementations that take advantage of existing CMOS VLSI technologyare, therefore, the preferred choice. As a result, switched-capacitordesign techniques were used because of ease of integration in CMOStechnology.

CMOS implementations, however, are known for offset-voltage problems andthis can limit the final performance of a circuit. For example, anoffset-voltage in the integrator of the DSM will introduce an error inthe output bit-stream representation and also limit the dynamic range ofthe input signals allowed. Hence, circuit techniques that compensate foroffset-voltages in the DSM's integrator are necessary. The configurationfor a stray-insensitive offset-compensated (OC) circuit was thereforeused. The resulting DSM circuit is shown in FIG. 37.

Since the signal processing schemes were developed for unipolar signals(bipolar source signals are rectified to obtain a unipolar swing), theADC only needs to represent unipolar analog signals. Hence, the twolevel quantizer or comparator in the DSM can use zero Volts and somepositive reference voltage as the two levels of representation. FiveVolts was chosen as the positive voltage level so that the ADC could beinterfaced to conventional digital processing circuits. This also meansthat input voltages in the range of zero to five Volts could berepresented by the ADC. Input signals exceeding 5 Volts needed to bescaled before being fed to the DSM.

In order for the DSM to operate satisfactorily, the integrator in theDSM should not saturate. Simulation studies show that the integratorvoltage rails need to be twice as large as the maximum input voltageused in order to ensure that saturation does not occur. The integratorwas, therefore, made to operate from +/- 10 Volt supply rails. (It wasalso found that an integrator rail voltage of four times the maximuminput voltage would be required if bipolar input signals were to beused.)

The characteristics of the operational amplifier play an important rolein determining the overall performance of the DSM. It has been foundthat the signal to noise ratio (SNR) of the DSM degrades when theoversampling ratio (OSR) exceeds the open-loop gain of the amplifier.Furthermore, the performance of the offset compensated circuit dependson the gain of the amplifier as well. The amplifier's bandwidth, inturn, determines the maximum sampling frequency and slew rate that canbe afforded. Hence, it was important to ensure that these parameterswere taken into account when designing the DSM. The LM833 amplifier usedhad a voltage gain of 110 dB and the multi-bit modulating squaringscheme allowed the use of an OSR of only 4096 (in contrast to OSRs of32K for stochastic squaring schemes). These two parameters, therefore,ensured that the DSM operated within the limitations of the amplifier.

Parasitic effects due to switch capacitances needed to be taken intoaccount as well. Clock feedthrough and charge injection play a majorrole in limiting the performance of the DSM. In order to achieve smallcircuit sizes it is desirable to use minimum capacitance values and keepthe capacitance spread (for example, C_(F) /C_(R)) close to unity. Smallcapacitance values also demand less current from the amplifiers for adesired slew rate. However, clock feedthrough and charge injectioneffects get worse as capacitance values get small. For the discreteimplementation, a capacitance value of C_(F) =C_(R) =330 pF wasempirically found to give the optimum performance. The use ofcomplementary switches helped improve the performance as well, since thecomplementary clock voltages aided in alleviating the clock feedthrougheffects and reducing the switch resistance for input voltages at eitherend of the signal range. Such complementary switches were made availableby using the analog transmission gate switches provided commercially byMotorola's HC4066 analog switch.

In general, differential circuit structures can be used to mitigate theproblems caused by clock feedthrough, charge injection and power supplynoise. This is because the complementary structures (assuming they areidentical) result in the cancelling of what becomes common-mode noise.This enhancement in performance, however, comes at the expense of almostdoubling the circuit complexity as shown in FIG. 38. Due to the addedwiring complexity, the differential circuit was not used in theimplementation. The use of such a circuit is, nevertheless, highlyrecommended when one proceeds with a VLSI implementation of the ADC.

The above issues were considered when building a prototype in the formof a discrete component DSM based ADC, so that a reasonable idea of thecircuit complexity and size could be obtained in a VLSI implementation.It should be noted, however, that extensive literature on theoptimization of DSM designs exist.

Threshold Detection Circuit

In this implementation, the threshold detection circuit consisted of theDSM based ADC on the front end, and the FPGA implementedrunning-averager scheme described previously. The running-averagerscheme allowed for the circuit to be designed without the use of controlcircuitry that would typically be required in a conventional "accumulateand dump" decimation circuit. In this implementation, the circuit wasused simply as a voltmeter for observation since the actual thresholddecision circuitry is simple for a person skilled in the art toimplement and the values used are system dependent.

In a convenient implementation a running averager used in a supervisorycircuit can call up addresses in a ROM containing data identifyingwhether the address value corresponds to valid, marginal or invalidsignal levels. In this embodiment, the BCD can be replaced by a binarycounter, the contents of which are used to address a ROM containing userspecified threshold values.

For a display to observe the embodiment of the invention studied, an8-bit voltmeter was implemented by using an input latency of 256 bits. Athree digit binary coded decimal (BCD) Up/Down counter was used toaccommodate the 8-bit quantity, with the DSM bit-stream being fed to theUp input and the 256-bit delayed version being fed to the Down input ofthe counter. A BCD to 7-segment display decoder was then used to obtaina digital readout of the counter's contents. Since the DSM was designedto operate with an input ranging between zero and five volts, a readingof `256` on the digital display corresponded to the full scale inputvoltage of 5 volts, while a reading of `000` corresponded to an inputvoltage of 0 volts. A reading of `256` is possible since a BCD countercapable of counting up to '999 was used. Input voltages between zero andfive volts were appropriately scaled, with a 2.5 volt input beingdisplayed as `128`, for example. FIG. 39 shows the block diagram of thevoltmeter circuit. Since the counter updates at the same rate as theDSM, both systems shared the same clock. The shift register or latencyblock had a separate RESET line from that of the counter, however, asthis allowed for offset voltages from the source to be nulled orcancelled in the counter. Hence, dc offset-compensation was digitallyachieved following the DSM stage.

Root-Mean-Square Circuit

The RMS circuit was designed to operate on a rectified ac signal, takingadvantage of the fact that the signal is symmetrical about the x-axis. Afull-wave rectifier circuit was therefore required, in order to be ableto use the unipolar ADC and signal processing schemes developed. A"super-diode" based full-wave rectifier, was hence built, in order toensure that the rectified signal was not distorted from the forwardvoltage drops of the rectifying diodes. A zero-crossing detector (ZCD)was also used so that the mean-squared value could be properly evaluatedover the signal's period. The ZCD was implemented using a hysteresis of500 mV.

The processing circuit for the RMS evaluation was based on the multi-bitmodulated squaring and stochastic square-rooting schemes. As mentionedearlier, the RMS measurement is carried out in two steps. The first stepconsists of evaluating the mean-squared value of the signal over halfthe signal's period (since the signal is assumed symmetrical about thex-axis). The second step consists of calculating the square-root of themean-squared value obtained. A synchronous state machine (SM) wasdesigned to control and direct the RMS computation. The state diagramfor this controller is shown in FIG. 40.

FIG. 40 only shows the input conditions under which a state transitionoccurs. This was done in order to highlight the main flow of operationand ensure the readability of the diagram. The controller used threeinputs to determine which state the processor should be in. These threeinputs were:

(i) C1=RUN AND ZCD (where RUNis the user controlled start switch and ZCDis the output of the zero-crossing detector)

(ii) SQ₋₋ OUT=Time-Out of 32K counter/timer (controls the sample sizefor square-root operation)

(iii) LOOP=Measurement mode; allows either one-shot or continuousmonitoring mode

These three inputs along with the machine's state determined the SM'soutputs. The four controlling outputs were:

(i) LATCH₋₋ M=Enables accumulation of the squared signal value formean-square evaluation

(ii) LATCH₋₋ S=Enables 32K counter/timer and the accumulation of thesquare-rooted bit-stream in a BCD counter for display purposes

(iii) LOAD=Loads contents of the BCD counter into the display register

(iv) RESET=Resets all counters, timers and registers except the displayregister, in preparation for the next evaluation

In terms of the actual computing structures involved, one recalls thatthe optimum parameters for the RMS scheme (shown in FIG. 34) weredeveloped to obtain a full-scale computing error below -40 dB. Thisperformance was achieved by using an OSR of 4096 for the DSM and arunning-averager with a 7-bit counter in the squaring step. Themean-square evaluation, therefore, required a 19-bit accumulating adderto be used (recall from FIG. 24 that M=log₂ (OSR)+L). Also, themean-square evaluation was conducted at the same rate as the DSMsampling rate. For the square-rooting step, a 7-bit ADDIE using adecorrelating delay of 12 cycles and a 32K (K=1024) sample size percomputation were required. This sample size required that thesquare-rooting block run on a separate and faster clock than themean-square and DSM blocks. Hence, the actual implementation operated ontwo clocks with the slower clock (labelled `A Clock` in FIG. 42) beingused to run the ADC and mean-square operations, while the faster clock(labelled `D Clock` in FIG. 42) was used to run the stochasticsquare-rooting operation.

The multi-bit modulated squaring was performed by feeding each of the 7bits of the running-averager to an AND gate with the other input of eachof the AND gates being tied together and connected to the DSM output.The resulting outputs of the AND gates were, therefore, a modulatedversion of the running averager's 7-bit word. This modulated word wasthen fed to the accumulating adder circuit to obtain the mean-squaredvalue. The mean-square operation was conducted over half the signal'speriod, as mentioned earlier.

For the square-rooting operation, two randomization techniques were usedfor the generation of the probabilistic bit-stream. The variableprobability generator, described previously, was used to randomize thecontents of the accumulator after the mean-square operation while thecomparator based scheme shown in FIG. 14 was used to randomize thecounter contents of the square-rooting ADDIE. Both these techniquesrequired a pseudo-random noise generator and hence, a 16-bit LFSR wasimplemented in the FPGA.

The 16-bit size was chosen so that the limit-cycle of the LFSR (64Kcycles) exceeded the computing time of the square-root operation (32Kcycles). As an interesting aside, the LFSR structure was built usingEXCLUSIVE-NOR gates instead of EXCLUSIVE-OR gates, to accommodate thefact that all registers in the FPGA are cleared to zero upon power-up.The variable probability generator circuit was then designed in anarrangement that used an external set of ROMs as a look-up table. TheseROMs used the output from the LFSR registers as the least significantset of address lines while using the contents of the mean-squareaccumulator as the most significant set of address lines. The ROM wasthen programmed to contain data that would reflect the logicaloperations discussed previously (FIG. 18), whereby, the accumulatorcontents acted as the weighting coefficients, x_(i), and the LFSR bitsacted as the noise bits, a_(i). Two data bits were used for eachcombination of address inputs. One data bit carried the logical outcomeof the address combinations, while the other bit (carry bit) was used torepresent the event when all a_(i) were zero. The use of two data bitsallowed for the cascading of two or more ROMs for use in therandomization of larger binary words. This is illustrated by the exampleshown in FIG. 41 where the contents of an 8-bit counter are randomizedusing two 256 byte ROMS. For the square-rooting operation, the 16 mostsignificant bits of the mean-square accumulator contents were used forrandomization (all 19 bits were not used in order to reduce thecomponent count; this introduces negligible error). This meant that 16weighting bits and 16 noise bits were required to obtain the randomizedversion of the accumulator's contents. Using a 64K ROM, however, onlyallows 16 address lines per ROM. Hence, two `64K×8` ROMs were combinedin an arrangement similar to FIG. 41, in order to obtain theprobabilistic serial output representing the 16-bit word. It may benoted that the randomizer could have just as easily been implementedinside the FPGA using simple logic. This method of implementation wasused simply as an exploratory approach and also to allow the FPGA logicto be used more productively for other functions.

Referring to the visual display, to obtain a readout of the RMS value,the bit-stream generated by the squarerooting ADDIE was accumulated in a5-digit BCD counter and then transferred to a display register. Thecontents of the display register were then fed to a 7-segment displaydecoder which in turn was used to drive a 5-digit decimal LED displayoutside the FPGA. The RMS value was displayed as a decimal numberranging from 0 to 32K, where 32K represented the full scale input level.In other words, if a sinusoidal waveform with an amplitude of 5 Volts (5Volts=full-scale input level) were to be used as the input signal, thenthe RMS value displayed would be, ##EQU27## since the normalizing factorfor the input signal is 5 Volts and the normalizing factor for thedisplay is 32K.

FIG. 42 shows the functional block diagram of the overall RMS circuit.The resulting implementation of the RMS circuit was arranged so thatmost of the signal processing functions were carried out within theFPGA. Overall, the implementation allowed the circuit to be used as aconvenient true RMS voltmeter with the option of using it in either aone-shot or continuous monitoring mode.

Supervisory Circuit Layout

The previous three sections showed how most of the signal processingfunctions were carried out within the FPGA. Analog functions such as theDSM based ADC, and ZCD along with some minor logic were the onlycircuits to be implemented external to the FPGA. Most of these externalcircuits, however, were used in all the supervisory functions. Thisallowed a generic layout to be obtained, whereby, a single configurationROM (determined the supervisory function of the setup, as was indicatedpreviously. FIG. 43 shows the generic layout for one embodiment of thesupervisory circuit. The overall implementation illustrates that theconcepts and circuits used in the process of designing the supervisoryfunctions lend themselves to a layout or structure that can be easilyreconfigured to accommodate new or updated signal processingrequirements. It should also be pointed out that the randomizer ROMs,shown in FIG. 43, could have easily had their functions integratedwithin a larger FPGA structure, leaving only simple analog circuitsexternal to the FPGA.

Area Estimates

The design and hardware implementation of the computing structuresallowed for a fairly reasonable estimate to be made with regards to thecore area that may be occupied in silicon or the number of transistorsthat may be required in the integrated implementation of the supervisoryfunctions. The figures obtained can in turn be used to determine thefeasibility of a silicon implementation or its attractiveness in termsof the core area occupied. It was hence found that in 1.2 μm CMOStechnology, a DSM based ADC using a differential based circuit structureoccupies an area of approximately 0.10 mm².

The sizes for the digital signal processing supervisory functions wereevaluated in terms of the number of transistors that each functionrequired. Table 4.1 lists the number of transistors found to be requiredby each function along with an estimate of the core area that will beoccupied. It is interesting to note that the estimates show the variableprobability randomizer circuit to require only about half as manytransistors (and hence area) as that needed by the magnitude comparatorbased randomizing circuit.

This section dealt with the actual design and physical implementation ofthe threshold, mean-squared, and RMS circuits. Analog portions of thedesign were implemented using discrete components while most of thedigital signal processing functions were implemented within a FPGA. Thegeneric layout of the circuit allowed for a single configuration ROM todetermine the supervisory function of the setup. The overallimplementation also showed that the concepts and circuits used in theprocess of designing the supervisory functions, lend themselves to alayout or structure that can be easily reconfigured to accommodate newor updated signal processing requirements. Estimates of the areaoccupied by the DSM based ADC in 1.2 μm CMOS and the number oftransistors required for the digital signal processing circuits werealso made. The estimates obtained were attractive in terms of the arearequirements, with less than 7,000 transistors being required for theimplementation of the digital portion of all three supervisoryfunctions.

                  TABLE 4.1                                                       ______________________________________                                        Transistor Count for Supervisory Functions                                                                    Estimated                                     Processing Function Transistor Count                                                                          Core Area                                     ______________________________________                                        8-bit Voltmeter/Threshold Detector                                                                3458        0.33 mm.sup.2                                 7-bit RMS Computation (includes running                                                           6281        0.60 mm.sup.2                                 averager and means squarer                                                    ______________________________________                                    

The embodiments of the invention in which an exclusive property orprivilege is claimed are defined as follows:
 1. A supervisory circuitfor deriving a parametric output of an input signal comprising:a) inputmeans for receiving said input signal; b) mean square processor fordetermining the mean square value of the input of said input signal; c)conversion processor for converting said mean square value into a randompulse density modulated bitstream representative of said mean squarevalue; d) stochastic processor for converting said random pulse densitymodulated bitstream into a stochastic representation of the RMS value ofthe input signal; e) output means for outputting said stochasticrepresentation of said RMS value.
 2. A supervisory circuit for derivinga parametric output signal of an analog input signal comprising:a) inputcircuit including a delta-sigma analog to digital converter adapted toproduce a serial pulse density modulated bit stream representation ofsaid analog input signal; b) a running averager processor adapted toprocess said bit stream representation of said analog input signal toproduce a representation of the running average of said bitstream; c) amulti bit modulated squarer processor adapted to calculate the square ofsaid running average and integrate said square over a suitable timeperiod to derive a parallel binary representation of the mean squarevalue of said analog input signal; d) a randomizer adapted to convertsaid binary representation of the mean square value of the analog inputsignal to a serial random pulse density modulated bitstream; e) astochastic square root processor adapted to process said random pulsedensity modulated bitstream to produce a parametric signal correspondingto the root mean square value of said analog input signal; f) outputmeans to output said root mean square value signal.
 3. The supervisorycircuit of claim 2 wherein said stochastic square root processor isadapted to accept said serial random pulse density modulated bitstreamas input and uses as negative feedback the stochastic square of theoutput of said stochastic processor to produce an output correspondingto the root mean square value of said analog input signal.
 4. Thesupervisory circuit of claim 2 wherein:said running averager processoris adapted to process said bit stream representation of said analoginput signal to produce a parallel representation of the running averageof said bitstream; said multi bit modulated squarer processor is adaptedto calculate the square of said running average by modulating saidaverage by said serial pulse density modulated bitstream representationof said analog input signal to obtain a multi bit representation of saidanalog input signal squared, and integrate said square over the periodof said input signal or a suitable time period to derive a parallelbinary representation of the mean square value of said analog inputsignal; and, wherein said stochastic square root processor comprises:a)an up down counter having incrementing and decrementing inputs, and anoutput, and being adapted to receive said random pulse density modulatedbitstream at said incrementing input, the output signal of said counterbeing converted by a randomizer to an output random pulse densitymodulated bitstream, b) a feedback circuit, said output bitstream beingfurther modified by said feedback circuit to provide a decrementinginput to said counter, said feedback circuit comprising: a) adecorrelator to decorrelate said output bitstream; and, b) means to feedback the boolean product of said output bitstream and said decorrelatedbitstream (obtaining a squared representation of output value of thecounter) to said decrementing input of said counter, said output signalof said counter representing the square root of said mean square input,thereby producing a parametric signal which corresponds to the root meansquare value of the analog input signal.
 5. The supervisory circuit ofclaim 4 wherein said stochastic square root circuit is adapted toproducea) parallel output, and b) a serial output utilizing saidrandomizer to derive said serial output.
 6. A supervisory circuit whichis adapted to monitor an input signal including an analog voltage andproduce as an output, a parametric signal corresponding to said inputsignal, said circuit comprising:a delta-sigma analog-to-digitalconverter for receiving said input signal; stochastic processingcircuitries including circuit arrangement for obtaining a mean squarevalue signal of the input signal and a stochastic computation circuit,responsive to said mean square value signal, to provide a stochasticrepresentation of the RMS voltage of the input signal, operativelycoupled to said converter for receiving said input signal andstochastically processing said signal to derive a signal that representsa parametric measure of said input signal; and output means connected tosaid stochastic processor to output said parametric output signal whichis proportional to the RMS value of the input signal.
 7. A supervisorycircuit which is adapted to monitor an input signal and produce as anoutput, a parametric signal corresponding to said input signal, saidcircuit comprising:a delta-sigma analog-to-digital converter forreceiving said input signal; a stochastic processor coupled to saidconverter for receiving said input signal and stochastically processingsaid signal to derive a signal that represents a parametric measure ofsaid input signal; output means connected to said stochastic processorto output said parametric output signal; and a PROM adapted to responseto a signal derived by the stochastic processor of said supervisorycircuit to produce a threshold status output when said signal is withina preselected range of values.
 8. The supervisory circuit of claim 7wherein said PROM is adapted to respond to said root mean square valueoutput of said supervisory circuit.
 9. The supervisory circuit of claim8 wherein said PROM is adapted to respond to said root mean square valueoutput of said supervisory circuit.
 10. A supervisory circuit which isadapted to monitor an input signal and produce as an output, aparametric signal corresponding to said input signal, said circuitcomprising:a delta-sigma analog-to-digital converter for receiving saidinput signal; a stochastic processor coupled to said converter forreceiving said input signal and stochastically processing said signal toderive a signal that represents a parametric measure of said inputsignal that is made available externally; and output means connected tosaid stochastic processor to output said parametric output signal.
 11. Asupervisory circuit which is adapted to monitor an input signal andproduce as an output, a parametric signal corresponding to said inputsignal, said circuit comprising:a delta-sigma analog-to-digitalconverter for receiving said input signal; stochastic processingcircuitries including a running average circuit, a multi-bit modulatedsquarer circuit coupled to the running averager circuit, and astochastic computation circuit coupled to the squarer circuitoperatively coupled to said converter for receiving said input signaland stochastically processing said signal to derive a signal thatrepresents a parametric measure of said input signal; and output meansconnected to said stochastic processor to output said parametric outputsignal.
 12. The supervisory circuit of claim 11 further including aradomizer circuit coupled to the stochastic computation circuit.
 13. Thesupervisory circuit of claim 11 further including a sequence controllercoupled to the stochastic computation circuit and the modulated squarercircuit.
 14. A supervisory circuit which is adapted to monitor an inputsignal and produce as an output, a parametric signal corresponding tosaid input signal, said circuit comprising:a delta-sigmaanalog-to-digital converter for receiving said input signal; stochasticprocessing circuitries including a circuit arrangement for obtaining amean square value signal of the input signal and a stochasticcomputation circuit, responsive to said mean square value signal, toprovide a stochastic representation of the RMS voltage of the inputsignal, operatively coupled to said converter for receiving said inputsignal and stochastically processing said signal to derive a signal thatrepresents a parametric measure of said input signal; and output meansconnected to said stochastic processor to output said parametric outputsignal.
 15. A power supply comprising:a power convertor for convertingan input into a regulated output, and a supervisory circuit forcontrolling said power convertor; said power convertor being governed bysaid supervisory circuit, said supervisory circuit providing at leastone output control signal to said power converter wherein said at leastone output control signal is derived from stochastic processing of aninput signal corresponding to the input to said power supply whereinsaid stochastic processing is performed by stochastic processingcircuitries including, a circuit arrangement for obtaining a mean squarevalue signal of the input signal and a stochastic computation circuit,responsive to said mean square value signal, to provide a stochasticrepresentation of the RMS voltage of the input signal, concatenatedwithin said supervisory circuit.